{extend name="layout:base" /}

{block name="main"}
<div class="path">
    <div class="card mb-2 <?php echo fm_get_theme(); ?>">
        <h6 class="card-header">
            {:lng('ChangePermissions')}
        </h6>
        <div class="card-body">
            <p class="card-text">
                <?php $display_path = fm_get_display_path($file_path); ?>
                {$display_path['label']}: {$display_path['path']}<br>
            </p>
            <form action="" method="post">
                <input type="hidden" name="p" value="{:fm_enc(FM_PATH)}">
                <input type="hidden" name="chmod" value="{:fm_enc($file)}">

                <table class="table compact-table {:fm_get_theme()}">
                    <tr>
                        <td></td>
                        <td><b>{:lng('Owner')}</b></td>
                        <td><b>{:lng('Group')}</b></td>
                        <td><b>{:lng('Other')}</b></td>
                    </tr>
                    <tr>
                        <td style="text-align: right"><b>{:lng('Read')}</b></td>
                        <td><label><input type="checkbox" name="ur" value="1"<?php echo ($mode & 00400) ? ' checked' : '' ?>></label></td>
                        <td><label><input type="checkbox" name="gr" value="1"<?php echo ($mode & 00040) ? ' checked' : '' ?>></label></td>
                        <td><label><input type="checkbox" name="or" value="1"<?php echo ($mode & 00004) ? ' checked' : '' ?>></label></td>
                    </tr>
                    <tr>
                        <td style="text-align: right"><b><?php echo lng('Write') ?></b></td>
                        <td><label><input type="checkbox" name="uw" value="1"<?php echo ($mode & 00200) ? ' checked' : '' ?>></label></td>
                        <td><label><input type="checkbox" name="gw" value="1"<?php echo ($mode & 00020) ? ' checked' : '' ?>></label></td>
                        <td><label><input type="checkbox" name="ow" value="1"<?php echo ($mode & 00002) ? ' checked' : '' ?>></label></td>
                    </tr>
                    <tr>
                        <td style="text-align: right"><b><?php echo lng('Execute') ?></b></td>
                        <td><label><input type="checkbox" name="ux" value="1"<?php echo ($mode & 00100) ? ' checked' : '' ?>></label></td>
                        <td><label><input type="checkbox" name="gx" value="1"<?php echo ($mode & 00010) ? ' checked' : '' ?>></label></td>
                        <td><label><input type="checkbox" name="ox" value="1"<?php echo ($mode & 00001) ? ' checked' : '' ?>></label></td>
                    </tr>
                </table>

                <p>
                    {:token_field()}
                    <b><a href="javascript:history.go(-1);" class="btn btn-light"><i class="fa fa-reply-all"></i> <?php echo lng('Cancel') ?></a></b>&nbsp;
                    <button type="submit" class="btn btn-primary"><i class="fa fa-check-circle"></i> <?php echo lng('Change') ?></button>
                </p>
            </form>
        </div>
    </div>
</div>
{/block}